<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <!-- import CSS -->
    <link rel="stylesheet" href="style/index.css">
</head>
<body style="margin:0">
<div id="app">

    <el-container>
<!--        width 设死 不能折叠面板-->
        <el-menu default-active="5"
                 class="el-menu-vertical-demo"
                 :collapse="isCollapsed"
                 @close="handleDialogClose"
                 style="width: 200px;"
                 background-color="#475074"
                 text-color="#878faf"
                 active-text-color="#fff">
            <div class="aside-header">
                <i class="el-icon-s-promotion " style="font-size: 30px"></i>
            </div>
            <el-menu-item index="1" onclick="location='/'" >
                <i class="el-icon-s-marketing"></i>
                <span slot="title">数据看板</span>
            </el-menu-item>
            <el-menu-item index="2" >
                <i class="el-icon-lightning"></i>
                <span slot="title">故障中心</span>
            </el-menu-item>
            <el-menu-item index="3" >
                <i class="el-icon-share"></i>
                <span slot="title">节点状态管理</span>
            </el-menu-item>
            <el-menu-item index="4" >
                <i class="el-icon-s-order"></i>
                <span slot="title">日志数据管理</span>
            </el-menu-item>
            <el-menu-item index="5" onclick="location='/model'">
                <i class="el-icon-first-aid-kit"></i>
                <span slot="title">诊断模型管理</span>
            </el-menu-item>
        </el-menu>
        <div class="aside-header" id="sysTitle" style="position: absolute; margin-left: 35px" ><b>智能运维系统</b></div>
        <el-container>
            <el-header style="text-align: right; font-size: 12px; box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
            margin-bottom: 1px" >
                <div style="float: left; font-size: 20px">
                    <i class="el-icon-s-fold " @click="handleCollapsed" id="foldButton"></i>
                </div>
                <div style="height: 54px; float: right; display:flex;align-items:center;">
                    <el-avatar src="img/head.jpeg" class="el-header-items"></el-avatar>
                    <span class="el-header-items">{{name}}</span>
                    <el-dropdown>
                        <i class="el-icon-caret-bottom el-header-items" style="margin-right: 15px; "></i>
                        <el-dropdown-menu slot="dropdown">
                            <el-dropdown-item>个人空间</el-dropdown-item>
                            <el-dropdown-item>退出登录</el-dropdown-item>
                        </el-dropdown-menu>
                    </el-dropdown>
                </div>
            </el-header>
            <el-main>
                <el-row :gutter=20>
                    <el-col :span=5>
                        <el-row :span=8 v-for="item in modelList">
                            <el-card :body-style="{ height: 300, padding: '0px' }">
                                <div style="padding: 14px;">
                                    <div>模型 #{{item.model_id}}</div>
                                    <div>{{item.model_name}}</div>
                                    <div class="bottom clearfix" style="width: 100%">
                                        <el-button v-if="item.model_id != runningModel"
                                                   type="text" style="float: right; padding-left: 10px"
                                                   @click="useModel(item.model_id)">
                                            使用模型
                                        </el-button>
                                        <el-button v-if="item.model_id == runningModel"
                                                   type="text" disabled style="float: right; padding-left: 10px">
                                            使用中
                                        </el-button>
<!--                                        <el-button v-if="item.type" type="text"-->
<!--                                                   class="button" style="float: right"-->
<!--                                                   @click="inputTrainParam(item.model_id)">-->
<!--                                            模型参数-->
<!--                                        </el-button>-->
                                    </div>
                                </div>
                            </el-card>
                        </el-row>
                        <el-button type="primary" style="width: 100%" @click="inputTrainParam()">
                            训练模型
                        </el-button>

                    </el-col>
                    <el-col :span=19 >
                        <el-card>
                            <el-tabs v-model="activeName">
                                <el-tab-pane label="模型评测" name="first">
                                    <el-row :gutter=12>
                                        <el-col :span=14>
                                            <el-button type="primary"
                                               @click=newModelTest()>
                                                新增评测
                                            </el-button>
                                        </el-col>
                                        <el-col :span=3>
                                            <el-select v-model="base_task_id" placeholder="基准任务">
                                                <el-option
                                                        v-for="item in reportIDs"
                                                        :key="item"
                                                        :label="item"
                                                        :value="item">
                                                </el-option>
                                            </el-select>
                                        </el-col>
                                        <el-col :span=1>
                                            <div style="text-align: center;height: 40px; line-height: 40px">
                                                vs
                                            </div>
                                        </el-col>
                                        <el-col :span=3>
                                            <el-select v-model="compare_task_id" placeholder="比较任务">
                                                <el-option
                                                        v-for="item in reportIDs"
                                                        :key="item"
                                                        :label="item"
                                                        :value="item">
                                                </el-option>
                                            </el-select>
                                        </el-col>
                                        <el-col :span=3>
                                            <el-button type="success" @click="submitCompare(base_task_id, compare_task_id)">开始对比</el-button>
                                        </el-col>
                                    </el-row>
                                    <el-row>
                                        <el-table
                                                :data="reportData"
                                                style="width: 100%"
                                                height="500px"
                                                max-height="500px">
                                            <el-table-column
                                                    fixed
                                                    prop="task_id"
                                                    label="任务id"
                                                    width="150">
                                            </el-table-column>
                                            <el-table-column
                                                    prop="model_name"
                                                    label="模型"
                                                    width="120">
                                            </el-table-column>
                                            <el-table-column
                                                    prop="dataset_name"
                                                    label="数据集"
                                                    width="240">
                                            </el-table-column>
                                            <el-table-column
                                                    prop="start_time"
                                                    label="测评时间"
                                                    width="200">
                                            </el-table-column>
                                            <el-table-column
                                                    prop="status"
                                                    label="状态"
                                                    width="120">
                                                <template slot-scope="scope">
                                                    <el-button v-if="scope.row.status == 0" type="success">
                                                        已生成
                                                    </el-button>
                                                    <el-button v-if="scope.row.status == 1" type="info" :loading="true">
                                                        生成中
                                                    </el-button>
                                                </template>
                                            </el-table-column>
                                            <el-table-column
                                                    label="报告链接"
                                                    fixed = "right"
                                                    width = "80">
                                                <template slot-scope="scope">
                                                    <el-button
                                                            @click=showReportDetail(scope.row.task_id)
                                                            type="text"
                                                            size="small">
                                                        查看报告
                                                    </el-button>
                                                </template>
                                            </el-table-column>
                                        </el-table>
                                    </el-row>

                                    <el-pagination
                                            @current-change="handleEvaReportChange"
                                            background
                                            layout="prev, pager, next"
                                            :total="evaluatePage">
                                    </el-pagination>
                                </el-tab-pane>
                                <el-tab-pane label="对比结果" name="second">
                                    <el-row>
                                    </el-row>
                                    <el-row>
                                        <el-table
                                                :data="compareData"
                                                style="width: 100%"
                                                height="500px"
                                                max-height="500px">
                                            <el-table-column
                                                    fixed
                                                    prop="task_id"
                                                    label="任务id"
                                                    width="150">
                                            </el-table-column>
                                            <el-table-column
                                                    prop="base_model_name"
                                                    label="基准模型"
                                                    width="160">
                                            </el-table-column>
                                            <el-table-column
                                                    prop="compare_model_name"
                                                    label="比较模型"
                                                    width="160">
                                            </el-table-column>
                                            <el-table-column
                                                    prop="start_time"
                                                    label="测评时间"
                                                    width="240">
                                            </el-table-column>
                                            <el-table-column
                                                    label="状态"
                                                    width="120">
                                                <template slot-scope="scope">
                                                    <el-button type="success">
                                                        已生成
                                                    </el-button>
                                                </template>
                                            </el-table-column>
                                            <el-table-column
                                                    label="报告链接"
                                                    fixed = "right"
                                                    width = "80">
                                                <template slot-scope="scope">
                                                    <el-button
                                                            @click=showCompareDetail(scope.row.task_id)
                                                            type="text"
                                                            size="small">
                                                        查看报告
                                                    </el-button>
                                                </template>
                                            </el-table-column>
                                        </el-table>
                                    </el-row>

                                    <el-pagination
                                            @current-change="handleDiffReportChange"
                                            background
                                            layout="prev, pager, next"
                                            :total="diffPage">
                                    </el-pagination>
                                </el-tab-pane>
                            </el-tabs>

                        </el-card>
                    </el-col>
                </el-row>
            </el-main>
        </el-container>
    </el-container>
    <el-drawer
            title="新增测评"
            :visible.sync="drawer"
            :with-header="true"
            size="40%">
        <div style="padding-left: 25px; padding-right: 25px">
            <el-row :gutter=2>
                <el-col :span=6>
                    <div class="sumup-left">
                        数据集
                    </div>
                </el-col>
                <el-col :span=12>
                    <el-row>
                        <el-radio-group v-model="datasetRD">
                            <el-radio label="1">选取数据集</el-radio>
                            <el-radio label="2">上传本地数据集</el-radio>
                        </el-radio-group>
                    </el-row>
                    <el-row v-if="datasetRD == 1">
                        <el-select v-model="evaluateModel.dataset" style="width: 100%">
                            <el-option
                                    v-for="item in evaluateDatasets"
                                    :key="item.dataset_id"
                                    :label="item.dataset_name"
                                    :value="item.dataset_id">
                            </el-option>
                        </el-select>
                    </el-row>
                    <el-row v-else >
                        <el-upload
                                class="upload-demo"
                                action="#"
                                drag
                                :on-success="handleUploadSuccess">
                            <i class="el-icon-upload"></i>
                            <div class="el-upload__text" style="width: 100%">将数据文件拖到此处，或<em>点击上传</em></div>
                            <div class="el-upload__tip" slot="tip">只能上传csv文件，且不超过5GB</div>
                        </el-upload>
                    </el-row>
                </el-col>
            </el-row>

            <el-row :gutter=2>
                <el-col :span=6>
                    <div class="sumup-left">
                        选择测评模型
                    </div>
                </el-col>
                <el-col :span=12>
                    <el-checkbox-group v-model="evaluateModel.models">
                        <el-checkbox v-for="item in modelList"
                                     :label="item.model_id"
                                     :value="item.model_id">
                            {{item.model_name}}
                        </el-checkbox>'
                    </el-checkbox-group>
                </el-col>
            </el-row>
            <el-button type="primary" style="float: right;" @click=submitReview>
                生成报告
            </el-button>
        </div>
    </el-drawer>
    <el-drawer
            title="测评报告"
            :visible.sync="reportDrawer"
            :with-header="true"
            size="60%">
        <div style="padding-left: 25px" v-loading="loading">
            <el-row>
                <span class="tip">任务-{{reportTaskDetail.report_task_id}}</span>
            </el-row>
            <el-row class="sumup-left">
                <el-col :span=6 >
                    模型ID: {{reportTaskDetail.model_id}}
                </el-col>
                <el-col :span=9>
                    数据集: data{{reportTaskDetail.dataset_id}}
                </el-col>
                <el-col :span=9>
                    测评时间: {{reportTaskDetail.start_time}}
                </el-col>
            </el-row>
            <el-row>
                <el-table
                        :data="reportTaskDetail.scores"
                        :border=true
                        style="width: 100%"
                        height="500px"
                        max-height="500px">
                    <el-table-column
                            fixed
                            prop="metrics"
                            label="Metrics"
                            width="240">
                    </el-table-column>
                    <el-table-column
                            prop="score"
                            label="分值"
                            width="480">
                    </el-table-column>
                </el-table>
            </el-row>
        </div>
    </el-drawer>
    <el-drawer
            title="对比报告"
            :visible.sync="compareDrawer"
            :with-header="true"
            size="60%">
        <div style="padding-left: 25px" v-loading="loading">
            <el-row>
                <span class="tip">任务-{{diffTaskDetail.diff_task_id}}</span>
            </el-row>
            <el-row class="sumup-left">
                <el-col :span=6 >
                    基准模型ID: {{diffTaskDetail.base_model_id}}
                </el-col>
                <el-col :span=9>
                    对比模型ID: {{diffTaskDetail.compare_model_id}}
                </el-col>
                <el-col :span=9>
                    测评时间: {{diffTaskDetail.start_time}}
                </el-col>
            </el-row>
            <el-row class="sumup-left">
                <el-col :span=6 >
                    基准任务ID: {{diffTaskDetail.base_task_id}}
                </el-col>
                <el-col :span=9>
                    对比任务ID: {{diffTaskDetail.compare_task_id}}
                </el-col>
                <el-col :span=9>
                    数据集: {{diffTaskDetail.base_dataset_id}} & {{diffTaskDetail.compare_dataset_id}}
                </el-col>
            </el-row>
            <el-row>
                <el-table
                        :data="diffTaskDetail.scores"
                        :border=true
                        style="width: 100%"
                        height="500px"
                        max-height="500px">
                    <el-table-column
                            fixed
                            prop="metrics"
                            label="Metrics"
                            width="120">
                    </el-table-column>
                    <el-table-column
                            prop="base_score"
                            label="基准模型分值"
                            width="240">
                    </el-table-column>
                    <el-table-column
                            prop="compare_score"
                            label="对比模型分值"
                            width="240">
                    </el-table-column>
                    <el-table-column
                            prop="diff_score"
                            label="差值"
                            width="240">
                    </el-table-column>
                </el-table>
                <el-alert
                        type="success"
                        style="font-size: 16px"
                        :closable="false">
                    <div style="font-size: 14px; font-weight: 800; margin-bottom: 5px">比对结果</div>
                    <div style="font-size: 14px">{{diffTaskDetail.conclude}}</div>
                </el-alert>
            </el-row>
        </div>
    </el-drawer>
    <el-drawer
            title='训练模型'
            :visible.sync="trainingDrawer"
            size="60%">
        <div style="padding: 0 25px 0 25px;">
            <el-row :gutter=2>
                <el-col :span=6> 选择模型 </el-col>
                <el-col :span=12>
                    <el-select style="width: 100%" v-model="trainModel.model_id">
                        <el-option v-for="item in modelList"
                                   :key="item.model_id"
                                   :label="item.model_name"
                                   :value="item.model_id">
                        </el-option>
                    </el-select>
                </el-col>
            </el-row>
            <el-row :gutter=2>
                <el-col :span=6> 训练数据 </el-col>
                <el-col :span=12>
                    <el-select v-model="trainModel.dataset" style="width: 100%">
                        <el-option v-for="item in dataset"
                                   :key="item.dataset_id"
                                   :label="item.dataset_name"
                                   :value="item.dataset_id">
                        </el-option>
                    </el-select>
                </el-col>
                <el-col :span=6 >
                    <el-upload
                            style="float: right"
                            class="upload-demo"
                            action="#"
                            :on-success="uploadTrainingDS">
                        <el-button>上传数据集</el-button>
                    </el-upload>
                </el-col>
            </el-row>
            <el-row :gutter=2>
                <el-col :span=6> 滑动窗口大小 </el-col>
                <el-col :span=18>
                    <el-input v-model="trainModel.windlw" placeholder="请输入滑动窗口大小"></el-input>
                </el-col>
            </el-row>
            <el-row :gutter=2>
                <el-col :span=6> 特征选择 </el-col>
                <el-col :span=18>
                    <el-radio v-model="trainModel.feature" label="1">序列</el-radio>
                    <el-radio v-model="trainModel.feature" label="2">计数</el-radio>
                </el-col>
            </el-row>
            <el-row :gutter=2>
                <el-col :span=6> 模型大小 </el-col>
                <el-col :span=18>
                    <el-input v-model="trainModel.windlw" placeholder="请输入滑动模型大小"></el-input>
                </el-col>
            </el-row>
            <el-row :gutter=2>
                <el-col :span=6> 训练相关 </el-col>
                <el-col :span=18>
                    <el-input v-model="trainModel.param" placeholder="请输入"></el-input>
                </el-col>
            </el-row>
            <el-row :gutter=2>
                <el-col :span=6> 预测相关 </el-col>
                <el-col :span=18>
                    <el-input v-model="trainModel.predict" placeholder="请输入"></el-input>
                </el-col>
            </el-row>
            <el-button type="primary" style="float: right;" @click=startTraining()>
                开始训练
            </el-button>
        </div>
    </el-drawer>
</div>
</body>
<!-- import Vue before Element -->
<script src="js/vue.js"></script>
<!-- import JavaScript -->
<script src="js/element.js"></script>
<script src="js/vue-resource.js"></script>
<script>
    var startValue = 100;
    var vm = new Vue({
        el:'#app',
        data:{
            service:{},
            modelList:[],
            serviceInfoShow: false,
            drawer: false,
            reportDrawer: false,
            compareDrawer: false,
            dialogVisible: false,
            isCollapsed: false,
            name: null,
            logData:[],
            reportData: [],
            reportIDs: [],
            reportTaskDetail: {},
            diffTaskDetail: {},
            compareData:[],
            relativeData: [],
            exception:{},
            props: { multiple: true },
            conditionValue: [],
            base_task_id: null,
            compare_task_id: null,
            runningModel: {},
            reviewModels:[],
            trainingDrawer: false,
            trainModel: {},
            datasetRD: '1',
            fileUrl: '',
            dataset: [],
            evaluateDatasets:[],
            conclude:'',
            loading:false,
            evaluatePage: 10,
            diffPage: 10,
            evaluateModel: {
                models:[]
            },
            conditions: [{
                value: startValue,
                label: '服务节点',
                children: []
            }, {
                value: 1,
                label: '级别',
                children: [
                    { value: 2, label: '一般' },
                    { value: 3, label: '严重' },
                    { value: 4, label: '紧急' }
                ]
            }, {
                value: 5,
                label: '状态',
                children: [
                    { value: 6, label: '未处理' },
                    { value: 7, label: '已处理' },
                    { value: 8, label: '非异常' }
                ]
            }],
            processLabel: [
                { value: 0, label: '未处理' },
                { value: 1, label: '已处理' },
                { value: 2, label: '非异常' }
            ],
            value: 1,
            activeName: 'first',
            activities: [{
                id: '132190',
                kind: '日志',
                service: 'grpc.sockshop.cart',
                content: 'The beacon class location is jar:file:/Users/jialichun/skywalking-agent/skywalking-agent.jar!/org/apache/skywalking/apm/agent/core/boot/AgentPackagePath.class...',
                type: 'danger',
                size: 'large'
            }, {
                id: '108201',
                kind: '日志',
                service: 'grpc.sockshop.order',
                content: 'Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release....',
            }, {
                id: '239561',
                kind: '指标',
                service: 'grpc.sockshop.category',
                content: 'configFailed',
            }, {
                id: '1000001',
                kind: '日志',
                service: 'springdemo',
                content: 'Failed to bind to address /0.0.0.0:11800',
                type: 'primary',
                icon: 'el-icon-more',
                size: 'large'
            }],
            options:[{
                value: '0',
                label: '平台模型',
                children: [{
                    value: '1',
                    label: '模型1'
                }, {
                    value: '2',
                    label: '模型2'
                }]
            },{
                value: '3',
                label: '本地模型',
                children: [{
                    value: '4',
                    label: '模型3'
                }]
            }]
        },
        mounted() {
            let formData = new FormData();
            formData.append('name', '管理员');


            this.$http.post('http://localhost:8090/user',formData).then(function(res){
                console.log(res)
                this.name = res.body.name
            },function(){
                console.log('请求失败处理');
            });
            this.getReportList(0, 7)
            this.getDiffTaskList(0,7)

            this.$http.get('http://106.13.14.17:18888/all_evaluate_task_id').then(function(res){
                console.log(res)
                this.reportIDs = res.body.report_task_id;
            },function(){
                console.log('请求失败处理');
            });
            this.$http.get('http://106.13.14.17:18888/all_models').then(function(res){
                console.log(res)
                this.modelList = res.body.models;
                this.runningModel = 1;
            },function(){
                console.log('请求失败处理');
            });
            this.$http.get('http://106.13.14.17:18888/all_datasets').then(function(res){
                console.log(res)
                this.evaluateDatasets = res.body.datasets;
            },function(){
                console.log('请求失败处理');
            });
            this.$http.post('http://106.13.14.17:18888/num_evaluate_task').then(function(res){
                console.log(res)
                this.evaluatePage = (res.body.num + 1) / 7 * 10;
            },function(){
                console.log('请求失败处理');
            });
            this.$http.post('http://106.13.14.17:18888/num_compare_task').then(function(res){
                console.log(res)
                this.diffPage = (res.body.num + 1) / 7 * 10;
            },function(){
                console.log('请求失败处理');
            });
        },
        methods: {
            handleEvaReportChange(page) {
                this.getReportList(page-1, 7)
            },
            handleDiffReportChange(page) {
                this.getDiffTaskList(page-1, 7)
            },
            getReportList(offset, limit) {
                let formData = {};
                formData.offset=offset
                formData.limit=limit
                let formDataStr = JSON.stringify(formData)

                // this.$http.post('http://localhost:8090/history_review_reports',formData).then(function(res){
                this.$http.post('http://106.13.14.17:18888/evaluate_history',formDataStr,{emulateJSON:true}).then(function(res){
                    console.log(res)
                    this.reportData = res.body.evaluate_task;
                },function(){
                    console.log('请求失败处理');
                });
            },
            getDiffTaskList(offset, limit) {
                let formData = {};
                formData.offset=offset;
                formData.limit=limit
                // this.$http.post('http://localhost:8090/history_diff_task',formData).then(function(res){
                this.$http.post('http://106.13.14.17:18888/compare_history',JSON.stringify(formData)).then(function(res){
                    console.log(res)
                    this.compareData = res.body.compare_task;
                },function(){
                    console.log('请求失败处理');
                });
            },
            showServiceInfo(serviceID, serviceName, status) {
                this.service.id=serviceID
                this.service.name=serviceName
                this.service.host = "192.168.0.1"
                if (status === 0) {
                    this.service.status = "正常"
                } else if (status === 1) {
                    this.service.status = "异常"
                } else {
                    this.service.status = "故障"
                }
                this.serviceInfoShow = true
            },
            newModelTest() {
                this.drawer = true
            },
            showReportDetail(id) {
                let formData = {};
                formData.report_task_id = id
                // this.$http.post('http://localhost:8090/review_report',formData).then(function(res){
                this.$http.post('http://106.13.14.17:18888/evaluate_details',JSON.stringify(formData)).then(function(res){
                    console.log(res)
                    this.reportTaskDetail = res.body;
                    // this.reportTaskDetail.report_task_id = id
                    this.loading=false
                },function(){
                    console.log('请求失败处理');
                });
                this.reportTaskDetail.report_task_id = id
                this.loading=true
                this.reportDrawer = true
            },
            showCompareDetail(id) {
                let formData = {};
                formData.diff_task_id = id;
                this.$http.post('http://106.13.14.17:18888/compare_details',JSON.stringify(formData),{emulateJSON:true}).then(function(res){
                    console.log(res)
                    this.diffTaskDetail = res.body;
                    this.loading=false
                },function(){
                    console.log('请求失败处理');
                });
                this.diffTaskDetail.diff_task_id = id
                this.loading=true
                this.compareDrawer = true
            },
            submitReview() {
                let formData = {};
                formData.modelIDs=this.evaluateModel.models
                formData.dataSet=this.evaluateModel.dataset
                console.log("dataset: ", formData.dataSet)
                this.$http.post('http://106.13.14.17:18888/evaluate',JSON.stringify(formData)).then(function(res){
                    console.log(res)
                    this.getReportList(0, 7)
                    this.drawer = false
                    this.reviewModels = []

                },function(){
                    console.log('请求失败处理');
                });
            },
            submitCompare(base_id, compare_id) {
                let formData = {};
                formData.base_task = base_id
                formData.compare_task = compare_id
                this.$http.post('http://106.13.14.17:18888/compare',JSON.stringify(formData)).then(function(res){
                    console.log(res)
                    this.getDiffTaskList(0, 7)
                    this.activeName = 'second';

                },function(){
                    console.log('请求失败处理');
                });
            },
            useModel(id) {
              this.runningModel = id;
              console.log(id);
            },
            inputTrainParam(id) {
                this.trainModel.model_id = id
                console.log(id)
                this.trainingDrawer = true
            },
            handleUploadSuccess(res, file) {
                this.fileUrl = URL.createObjectURL(file.raw);
                let filename = file.name.substring(0, file.name.lastIndexOf("."));
                let formData = {dataset_name:filename}
                this.$http.post('http://106.13.14.17:18888/upload_dataset',JSON.stringify(formData)).then(function(res){
                    console.log(res)
                    let newdataset = {dataset_id: res.body.dataset.dataset_id, dataset_name: res.body.dataset.dataset_name}
                    this.evaluateDatasets.push(newdataset)
                    this.evaluateModel.dataset = newdataset.dataset_id
                },function(){
                    console.log('请求失败处理');
                });

                console.log('upload success ', filename)
            },
            uploadTrainingDS(res, file) {
                console.log(file)
                let newdataset = {dataset_id: 100000, dataset_name: file.name}
                this.dataset.push(newdataset)
                this.trainModel.dataset = newdataset.dataset_id
            },
            handleClickTab(tab, event) {
                console.log(tab, event);
            },
            tableHeadClassName({row, rowIndex}) {
                return 'log-table-head';
            },
            handleDialogClose(done) {
                this.$confirm('确认关闭？')
                    .then(_ => {
                        done();
                    })
                    .catch(_ => {});
            },
            handleConditionChange(value) {
                console.log(value);
            },
            handleCollapsed(event) {
                this.isCollapsed = !this.isCollapsed
                if (this.isCollapsed) {
                    document.getElementById("sysTitle").style.display="none"
                    document.getElementById("foldButton").className="el-icon-s-unfold"
                } else {
                    document.getElementById("sysTitle").style.display="block"
                    document.getElementById("foldButton").className="el-icon-s-fold"
                }
            }
        }
    });
</script>
<style>
    .menu-bt {
        color: #878faf;
        text-decoration: none;|
    }
    .text-base {
        font-size: 14px;
        line-height: 21px;
        height: 21px;
    }
    .text-extra-large {
        font-size: 20px;
        line-height: 34px;
        height: 34px;
    }
    .aside-header {
        color: white;
        height: 60px;
        line-height: 60px;
        padding-left: 18px;
    }
    .el-menu-item.is-active {
        background-color: #5473e8 !important;
    }
    .el-card {
        border: inherit;
    }
    .service-info {
        border-radius: 10px;
        width: 250px;
        height: 170px;
        background-image: url("img/service_info_bg.png");
        padding-top: 0; !important;
        color: white;
        box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);

        position: absolute;
    }
    .el-header {
        background-color: white;
        color: #333;
        line-height: 54px;
        height: 54px;
        vertical-align: middle;
    }

    .el-menu {
        color: #878faf;
        background-color: #475074;
    }
    .el-menu-vertical-demo:not(.el-menu--collapse) {
        width: 300px;
        min-height: 400px;
    }

    .el-main {
        background-color: #edf0f9;
    }

    .el-row {
        margin-bottom: 20px;
    }
    .el-header-items {
        margin-left: 10px;
    }
    .tip {
        border-left: 5px solid #5777e5;
        padding-left: 14px
    }
    .sumup {
        text-align: center;
        color: #8da1b4;
        font-size: 14px;
    }
    .sumup-left {
        color: #8da1b4;
        font-size: 14px;
    }
    .sumup-mid {
        border-right: 1px solid #e4ebf0;
    }
    .sumup-num {
        color: #252631;
        font-size: 20px;
        font-weight: 800;
    }
    .levelup {
        color: #f34c4b;
        font-weight: normal;
        font-size: 14px;
    }
    .leveldown {
        color: #24d9b8;
        font-weight: normal;
        font-size: 14px;
    }
    .log-table-head {
        color: #5777e5;
    }
</style>
</html>